package main

import (
	"fmt"
)

func updateSlice(s []int) {
	s[0] = 100
}

func main() {
	arr := [...]int{0,1,2,3,4,5,6,7}
	s := arr[2:6]
	fmt.Println("arr[2:6]=", s)

	s1 := arr[2:]
	//updateSlice(s1)
	s2 := arr[:]
	fmt.Println("s1=", s1)
	fmt.Println("s2=", s2)

	s1 = arr[2:6]  	//2,3,4,5
	s2 = s1[3:5]	//5,6
	fmt.Printf("s1=%v, len(s1)=%d, cap(s1)=%d.\n", s1, len(s1), cap(s1))
	fmt.Println(s1, s2)

	s3 := append(s2, 10)
	s4 := append(s3, 11)
	s5 := append(s4, 12)
	fmt.Println(s3, s4, s5)
}
